package com.wcy.serviceimpl;

import com.wcy.entity.Role;
import com.wcy.entity.UserRole;
import com.wcy.dao.UserRoleMapper;
import com.wcy.service.IUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @since 2021-04-30
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements IUserRoleService {

    @Autowired
    UserRoleMapper userRoleMapper;
    @Override
    public PageInfo<Role> queryAll(String persons, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Role> userRoleList = userRoleMapper.queryAll(persons);
        return new PageInfo<>(userRoleList);
    }
}
